]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
inputMethod: Equate empty preedit string to null
authorCarlos Garnacho <carlosg@gnome.org>
Fri, 29 Oct 2021 14:41:55 +0000 (16:41 +0200)
committerMarge Bot <marge-bot@gnome.org>
Mon, 1 Nov 2021 17:02:50 +0000 (17:02 +0000)
If we get '' from the IM as the preedit string, it is pretty safe
to handle it as "no preedit" altogether.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2011>

js/misc/inputMethod.js

index 1f9eaee7a8db2a1c27f3dd078ab5888805a0396b..7de7540d3f73e5e151d7c5c5f321e497f6efa1a1 100644 (file)
@@ -111,6 +111,8 @@ class InputMethod extends Clutter.InputMethod {
             return;
 
         let preedit = text.get_text();
+        if (preedit === '')
+            preedit = null;
 
         if (visible)
             this.set_preedit_text(preedit, pos, mode);